//height()
$('.load-h').height($('.load-i').find('img').height()); 
$(document).ready(function(){
     $('.load-i img').load(function(){
          $('.load-h').height($('.load-i').find('img').height()); 
     });
});
$('.rental-btn ul li').click(function(){
    $(this).parents('.rental-btn').find('.rental-title').text($(this).text());
});
 /*messge*/
$(".messge_nav").click(function () {
 
    $(".message_content").slideToggle();
});
$(window).scroll(function(){
   $(this).scrollTop() >1?$('.go-top').show(): $('.go-top').hide();
});
//phone
$('.nav-ico').click(function(){
    $('.col-nav ul').slideToggle();
});
//go top
$(".go-top").click(function(event){		
	event.preventDefault();
	$('html,body').animate({'scrollTop':0},600);
});
//寬度變化自動刷新
window.onresize = function(){
    location.reload(true);
};

//slide
    var swiper1 = new Swiper('.swiper1', {
        pagination: '.swiper-pagination1',
        nextButton: '.swiper-button-next1',
        prevButton: '.swiper-button-prev1',
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30
        
    });
     var swiper2 = new Swiper('.swiper2', {
        pagination: '.swiper-pagination2',
        nextButton: '.swiper-button-next2',
        prevButton: '.swiper-button-prev2',
        paginationClickable: true,
        spaceBetween: 30
         
    });
         var swiper4 = new Swiper('.swiper4', {
        pagination: '.swiper-pagination4',
        nextButton: '.swiper-button-next4',
        prevButton: '.swiper-button-prev4',
        paginationClickable: true,
        spaceBetween: 30
         
    });
  
    if(document.body.clientWidth < 750){
           var swiper3 = new Swiper('.swiper3', {
        pagination: '.swiper-pagination3',
        nextButton: '.swiper-button-next3',
        prevButton: '.swiper-button-prev3',
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30
         
    }); 

}
    else{
             var swiper3 = new Swiper('.swiper3', {
        pagination: '.swiper-pagination3',
        nextButton: '.swiper-button-next3',
        prevButton: '.swiper-button-prev3',
        slidesPerView: 3,
        slidesPerColumn: 2,
        paginationClickable: true,
        spaceBetween: 30
         
    });
  
    }
    //prettyPhoto	
$("area[rel^='prettyPhoto']").prettyPhoto();
$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed: 'normal', theme: 'light_square', slideshow: 300, autoplay_slideshow: false});
$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed: 'fast', slideshow: 10000, hideflash: true});
